Skip to content

Conversation

Jack251970
Copy link
Member

@Jack251970 Jack251970 commented Sep 18, 2025

CHANGES

  • Add Default Browser & File Explorer & New Profile Translation
  • Ignore index change for -1
  • Improve code quality

Fix #1330, #2758

TEST

  • UI
image image image
  • Adding new profile and then deleting will not catch exception anymore.

@github-actions github-actions bot added this to the 2.1.0 milestone Sep 18, 2025
@prlabeler prlabeler bot added the bug Something isn't working label Sep 18, 2025
@Jack251970 Jack251970 linked an issue Sep 18, 2025 that may be closed by this pull request
Copy link

gitstream-cm bot commented Sep 18, 2025

🥷 Code experts: onesounds, taooceros

Jack251970, onesounds have most 👩‍💻 activity in the files.
Jack251970, onesounds have most 🧠 knowledge in the files.

See details

Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs

Activity based on git-commit:

Jack251970 onesounds
SEP
AUG
JUL
JUN
MAY
APR

Knowledge based on git-blame:

Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs

Activity based on git-commit:

Jack251970 onesounds
SEP
AUG
JUL
JUN
MAY
APR

Knowledge based on git-blame:

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Activity based on git-commit:

Jack251970 onesounds
SEP 2 additions & 2 deletions
AUG
JUL 45 additions & 4 deletions
JUN 4 additions & 2 deletions
MAY 86 additions & 30 deletions 5 additions & 3 deletions
APR 34 additions & 83 deletions 104 additions & 38 deletions

Knowledge based on git-blame:
Jack251970: 32%
onesounds: 16%

Flow.Launcher.Infrastructure/Win32Helper.cs

Activity based on git-commit:

Jack251970 onesounds
SEP
AUG
JUL 57 additions & 20 deletions
JUN 5 additions & 0 deletions
MAY 110 additions & 3 deletions
APR 202 additions & 33 deletions 4 additions & 0 deletions

Knowledge based on git-blame:
Jack251970: 88%

Flow.Launcher/Languages/en.xaml

Activity based on git-commit:

Jack251970 onesounds
SEP 6 additions & 5 deletions
AUG 4 additions & 0 deletions
JUL 48 additions & 13 deletions
JUN 21 additions & 0 deletions 7 additions & 6 deletions
MAY 33 additions & 4 deletions 15 additions & 2 deletions
APR 22 additions & 21 deletions 45 additions & 23 deletions

Knowledge based on git-blame:
onesounds: 36%
Jack251970: 21%

Flow.Launcher/SelectBrowserWindow.xaml

Activity based on git-commit:

Jack251970 onesounds
SEP
AUG
JUL
JUN
MAY 4 additions & 3 deletions
APR 1 additions & 1 deletions 25 additions & 27 deletions

Knowledge based on git-blame:
onesounds: 97%
Jack251970: 2%

Flow.Launcher/SelectBrowserWindow.xaml.cs

Activity based on git-commit:

Jack251970 onesounds
SEP
AUG
JUL
JUN
MAY 15 additions & 46 deletions
APR 17 additions & 34 deletions 16 additions & 1 deletions

Knowledge based on git-blame:
onesounds: 40%
Jack251970: 27%

Flow.Launcher/SelectFileManagerWindow.xaml

Activity based on git-commit:

Jack251970 onesounds
SEP
AUG
JUL
JUN
MAY 13 additions & 20 deletions 25 additions & 9 deletions
APR 1 additions & 1 deletions 1 additions & 1 deletions

Knowledge based on git-blame:
onesounds: 92%
Jack251970: 4%

Flow.Launcher/SelectFileManagerWindow.xaml.cs

Activity based on git-commit:

Jack251970 onesounds
SEP
AUG
JUL
JUN
MAY 28 additions & 164 deletions 111 additions & 1 deletions
APR 18 additions & 35 deletions 16 additions & 0 deletions

Knowledge based on git-blame:
onesounds: 37%
Jack251970: 27%

Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs

Activity based on git-commit:

Jack251970 onesounds
SEP
AUG
JUL 8 additions & 8 deletions
JUN 2 additions & 0 deletions
MAY 15 additions & 4 deletions
APR 64 additions & 137 deletions 355 additions & 225 deletions

Knowledge based on git-blame:
Jack251970: 25%
onesounds: 13%

Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml

Activity based on git-commit:

Jack251970 onesounds
SEP
AUG
JUL 41 additions & 36 deletions
JUN 26 additions & 14 deletions 50 additions & 36 deletions
MAY 62 additions & 11 deletions
APR 11 additions & 8 deletions 130 additions & 69 deletions

Knowledge based on git-blame:
onesounds: 47%
Jack251970: 20%

Flow.Launcher/ViewModel/SelectBrowserViewModel.cs

Activity based on git-commit:

Jack251970 onesounds
SEP
AUG
JUL
JUN 0 additions & 1 deletions
MAY 64 additions & 1 deletions
APR

Knowledge based on git-blame:
Jack251970: 86%

Flow.Launcher/ViewModel/SelectFileManagerViewModel.cs

Activity based on git-commit:

Jack251970 onesounds
SEP
AUG
JUL
JUN
MAY 167 additions & 46 deletions
APR

Knowledge based on git-blame:
Jack251970: 89%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

Copy link

gitstream-cm bot commented Sep 18, 2025

Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.

Copy link
Contributor

coderabbitai bot commented Sep 18, 2025

📝 Walkthrough

Walkthrough

Introduces DisplayName properties with translation-based values for browser and file manager settings, adds OnDisplayNameChanged triggers, centralizes file selection via Win32Helper.SelectFile, updates XAML bindings to DisplayName, adjusts selection index guards, removes duplicated helper methods from viewmodels, and adds new language resources.

Changes

Cohort / File(s) Summary
UserSettings view models (localizable display names, IoC API)
Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs, Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs
Add lazy IoC-resolved API access; add [JsonIgnore] DisplayName computed from Name via translations; add OnDisplayNameChanged(); for browser add OpenInTab and derived [JsonIgnore] OpenInNewWindow.
Centralized file selection helper
Flow.Launcher.Infrastructure/Win32Helper.cs
Add public static SelectFile() using OpenFileDialog; minor non-functional header change.
Language resources
Flow.Launcher/Languages/en.xaml
Add keys: fileManagerExplorer, defaultBrowser_default, defaultBrowser_new_profile.
Settings UI bindings to DisplayName
Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml, Flow.Launcher/SelectBrowserWindow.xaml, Flow.Launcher/SelectFileManagerWindow.xaml
Change bindings from Name to DisplayName in buttons/combobox item templates.
Settings VM triggers for display name refresh
Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs
Call Settings.CustomExplorer.OnDisplayNameChanged() and Settings.CustomBrowser.OnDisplayNameChanged() after localization updates.
Select Browser flow tweaks
Flow.Launcher/ViewModel/SelectBrowserViewModel.cs, Flow.Launcher/SelectBrowserWindow.xaml.cs
Ignore negative SelectedCustomBrowserIndex; initialize new profile name via translation; remove SelectFile() from VM; use Win32Helper.SelectFile() in code-behind.
Select File Manager flow tweaks
Flow.Launcher/ViewModel/SelectFileManagerViewModel.cs, Flow.Launcher/SelectFileManagerWindow.xaml.cs
Guard negative SelectedCustomExplorerIndex; remove OpenUrl and SelectFile from VM; use App.API.OpenUrl and Win32Helper.SelectFile() in code-behind.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor User
    participant View as SelectBrowser/FileManager Window
    participant CodeBehind as XAML Code-Behind
    participant Helper as Win32Helper
    participant Dialog as OpenFileDialog

    User->>View: Click "Browse..."
    View->>CodeBehind: btnBrowseFile_Click
    CodeBehind->>Helper: SelectFile()
    activate Helper
    Helper->>Dialog: ShowDialog()
    alt User selects file and confirms
        Dialog-->>Helper: File path
        Helper-->>CodeBehind: selectedFilePath
        CodeBehind->>View: Update PathTextBox, focus
    else Cancel
        Dialog-->>Helper: Empty
        Helper-->>CodeBehind: ""
        CodeBehind->>View: No change
    end
    deactivate Helper
Loading
sequenceDiagram
    autonumber
    participant SettingsVM as SettingsPaneGeneralViewModel
    participant BrowserUS as CustomBrowserViewModel
    participant ExplorerUS as CustomExplorerViewModel
    participant Ioc as Ioc.Default
    participant API as IPublicAPI

    SettingsVM->>BrowserUS: OnDisplayNameChanged()
    BrowserUS->>BrowserUS: OnPropertyChanged(DisplayName)

    SettingsVM->>ExplorerUS: OnDisplayNameChanged()
    ExplorerUS->>ExplorerUS: OnPropertyChanged(DisplayName)

    note over BrowserUS,ExplorerUS: DisplayName getters resolve translations
    BrowserUS->>Ioc: Resolve IPublicAPI (lazy)
    Ioc-->>BrowserUS: API instance
    BrowserUS->>API: GetTranslation("defaultBrowser_default") when Name == "Default"
    ExplorerUS->>Ioc: Resolve IPublicAPI (lazy)
    Ioc-->>ExplorerUS: API instance
    ExplorerUS->>API: GetTranslation("fileManagerExplorer") when Name == "Explorer"
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • jjw24
  • onesounds

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title Check ✅ Passed The title accurately summarizes the primary changes in the diff: adding translations for Default Browser, File Explorer, and New Profile, plus ignoring index changes when the selected index becomes -1; it directly reflects the main code and UI updates present in the summary. Although somewhat long, it is specific and not misleading for someone scanning PR history.
Linked Issues Check ✅ Passed Addresses the coding objective in [#1330] by introducing DisplayName properties that call API.GetTranslation, updating UI bindings to use DisplayName, and adding the new translation keys to en.xaml so dropdown entries become localizable at runtime; these code changes satisfy the linked issue's requirement to make dropdowns translatable. The PR does not itself add locale-specific Spanish resource files, but the implemented code changes enable those translations to appear when locale files are present.
Out of Scope Changes Check ✅ Passed All notable changes described in the summary align with the PR objectives (translations, ignore index -1, and code-quality improvements such as centralizing file selection in Win32Helper), and I did not identify unrelated or unexpected modifications outside those goals. The refactors and UI binding updates appear consistent with the stated intent.
Description Check ✅ Passed The pull request description succinctly describes the changes (adding translations, handling index = -1, and code-quality improvements), references the issues fixed (#1330, #2758), and includes test screenshots, all of which are directly related to the changes summarized in the diff; it is not off-topic.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch default_browser_explorer_translation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Jack251970 Jack251970 requested a review from Copilot September 18, 2025 04:16
@Jack251970 Jack251970 added the kind/ui related to UI, icons, themes, etc label Sep 18, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the user experience for custom browser and file manager settings by adding proper translations, fixing UI binding issues, and preventing index errors when items are removed.

  • Adds translations for "Default Browser", "File Explorer", and "New Profile" to replace hardcoded English strings
  • Fixes index validation to prevent crashes when selected items are removed (-1 index handling)
  • Refactors duplicated file selection code into a centralized utility method

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Flow.Launcher/ViewModel/SelectFileManagerViewModel.cs Adds index validation and uses translated "New Profile" text
Flow.Launcher/ViewModel/SelectBrowserViewModel.cs Adds index validation and uses translated "New Profile" text
Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml Updates UI bindings to use DisplayName instead of Name
Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs Triggers display name updates when language changes
Flow.Launcher/SelectFileManagerWindow.xaml.cs Uses centralized Win32Helper.SelectFile() method
Flow.Launcher/SelectFileManagerWindow.xaml Updates ComboBox binding to use DisplayName
Flow.Launcher/SelectBrowserWindow.xaml.cs Uses centralized Win32Helper.SelectFile() method
Flow.Launcher/SelectBrowserWindow.xaml Updates ComboBox binding to use DisplayName
Flow.Launcher/Languages/en.xaml Adds translation keys for file explorer, default browser, and new profile
Flow.Launcher.Infrastructure/Win32Helper.cs Adds centralized SelectFile() utility method
Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs Adds DisplayName property with translation support
Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs Adds DisplayName property with translation support

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
Flow.Launcher/ViewModel/SelectFileManagerViewModel.cs (2)

68-76: Fix crash when Path is null/empty in IsFileManagerValid

Path.IsPathRooted(null) throws. New profiles (no path yet) will hit this in SaveSettings.

     private static bool IsFileManagerValid(string path)
     {
-        if (string.Equals(path, "explorer", StringComparison.OrdinalIgnoreCase))
+        if (string.Equals(path, "explorer", StringComparison.OrdinalIgnoreCase))
             return true;
 
+        if (string.IsNullOrWhiteSpace(path))
+            return false;
+
         if (Path.IsPathRooted(path))
         {
             return File.Exists(path);
         }

113-121: Deleting the last item leaves invalid selection

If the last profile is removed, you set index to 0 while the collection is empty; later access to CustomExplorer will throw.

     [RelayCommand]
     private void Delete()
     {
         var currentIndex = SelectedCustomExplorerIndex;
-        if (currentIndex >= 0 && currentIndex < CustomExplorers.Count)
+        if (currentIndex >= 0 && currentIndex < CustomExplorers.Count)
         {
+            // Prevent removing the last remaining profile
+            if (CustomExplorers.Count <= 1)
+                return;
+
             CustomExplorers.RemoveAt(currentIndex);
-            SelectedCustomExplorerIndex = currentIndex > 0 ? currentIndex - 1 : 0;
+            SelectedCustomExplorerIndex = Math.Min(currentIndex, CustomExplorers.Count - 1);
         }
     }
Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs (1)

19-22: Propagate change notifications from OpenInTab to OpenInNewWindow

OpenInNewWindow is computed; without raising PropertyChanged when OpenInTab changes, bindings to OpenInNewWindow won't update.

-public bool OpenInTab { get; set; } = true;
-[JsonIgnore]
-public bool OpenInNewWindow => !OpenInTab;
+private bool openInTab = true;
+public bool OpenInTab
+{
+    get => openInTab;
+    set
+    {
+        if (openInTab == value) return;
+        openInTab = value;
+        OnPropertyChanged(nameof(OpenInTab));
+        OnPropertyChanged(nameof(OpenInNewWindow));
+    }
+}
+[JsonIgnore]
+public bool OpenInNewWindow => !openInTab;
🧹 Nitpick comments (11)
Flow.Launcher.Infrastructure/Win32Helper.cs (1)

910-918: Make the file dialog modal to the owner and expose basic options.

Current dialog isn’t owned, so it may appear behind the window; also no way to set title/filter/initial dir. Add optional parameters and call the owner overload.

-public static string SelectFile()
+public static string SelectFile(
+    System.Windows.Window? owner = null,
+    string? title = null,
+    string? filter = null,
+    string? initialDirectory = null)
 {
-    var dlg = new OpenFileDialog();
-    var result = dlg.ShowDialog();
+    var dlg = new OpenFileDialog
+    {
+        Title = title ?? dlg?.Title,
+        Filter = filter ?? string.Empty,
+        InitialDirectory = initialDirectory ?? string.Empty,
+        CheckFileExists = true,
+        CheckPathExists = true,
+        Multiselect = false
+    };
+    var result = owner is null ? dlg.ShowDialog() : dlg.ShowDialog(owner);
     if (result == true)
         return dlg.FileName;

     return string.Empty;
 }
Flow.Launcher/SelectFileManagerWindow.xaml.cs (2)

34-38: Use the Uri overload of OpenUrl.

Avoids unnecessary string conversion.

-    App.API.OpenUrl(e.Uri.AbsoluteUri);
+    App.API.OpenUrl(e.Uri);

40-51: Own the file dialog and avoid fragile FindName traversal.

Pass this as owner (ensures modality/foreground) and use the generated PathTextBox field.

-    var selectedFilePath = Win32Helper.SelectFile();
+    var selectedFilePath = Win32Helper.SelectFile(this);
@@
-    if (!string.IsNullOrEmpty(selectedFilePath))
-    {
-        var path = (TextBox)(((FrameworkElement)sender).Parent as FrameworkElement).FindName("PathTextBox");
-        path.Text = selectedFilePath;
-        path.Focus();
-        ((Button)sender).Focus();
-    }
+    if (!string.IsNullOrEmpty(selectedFilePath))
+    {
+        PathTextBox.Text = selectedFilePath;
+        PathTextBox.Focus();
+        ((Button)sender).Focus();
+    }
Flow.Launcher/SelectBrowserWindow.xaml.cs (1)

33-44: Same here: own the dialog and avoid visual-tree lookup.

-    var selectedFilePath = Win32Helper.SelectFile();
+    var selectedFilePath = Win32Helper.SelectFile(this);
@@
-    if (!string.IsNullOrEmpty(selectedFilePath))
-    {
-        var path = (TextBox)(((FrameworkElement)sender).Parent as FrameworkElement).FindName("PathTextBox");
-        path.Text = selectedFilePath;
-        path.Focus();
-        ((Button)sender).Focus();
-    }
+    if (!string.IsNullOrEmpty(selectedFilePath))
+    {
+        PathTextBox.Text = selectedFilePath;
+        PathTextBox.Focus();
+        ((Button)sender).Focus();
+    }
Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs (2)

222-224: Refresh all profiles’ DisplayName, not just the selected ones.

Calling through Settings.CustomExplorer/Browser only updates one item and risks index issues. Notify all list items instead.

-OnPropertyChanged(nameof(AlwaysPreviewToolTip));
-Settings.CustomExplorer.OnDisplayNameChanged();
-Settings.CustomBrowser.OnDisplayNameChanged();
+OnPropertyChanged(nameof(AlwaysPreviewToolTip));
+foreach (var e in Settings.CustomExplorerList) e.OnDisplayNameChanged();
+foreach (var b in Settings.CustomBrowserList) b.OnDisplayNameChanged();

333-350: Consider centralizing file pickers on Win32Helper.SelectFile.

This WinForms OpenFileDialog can be replaced with the shared helper for consistency and less duplication.

Flow.Launcher/ViewModel/SelectBrowserViewModel.cs (1)

20-27: Raise PropertyChanged for SelectedCustomBrowserIndex as well.

Without notifying the index property, bindings to SelectedIndex may not update after programmatic changes (e.g., Add/Delete).

-    if (selectedCustomBrowserIndex != value)
-    {
-        selectedCustomBrowserIndex = value;
-        OnPropertyChanged(nameof(CustomBrowser));
-    }
+    if (selectedCustomBrowserIndex != value)
+    {
+        selectedCustomBrowserIndex = value;
+        OnPropertyChanged(); // SelectedCustomBrowserIndex
+        OnPropertyChanged(nameof(CustomBrowser));
+    }

Optional: clamp out-of-range values instead of ignoring negatives for extra robustness.

Flow.Launcher/Languages/en.xaml (1)

501-502: Naming nit: consider neutral key for reuse

defaultBrowser_new_profile is used by file-manager too. A neutral key like newProfile (or fileManager_new_profile + defaultBrowser_new_profile) would be clearer for translators.

Flow.Launcher/ViewModel/SelectFileManagerViewModel.cs (1)

24-26: Guard is good; also raise SelectedCustomExplorerIndex change

Ignoring -1 avoids noisy updates. Also raise PropertyChanged for SelectedCustomExplorerIndex so any selection bindings refresh.

-            if (selectedCustomExplorerIndex != value)
+            if (selectedCustomExplorerIndex != value)
             {
                 selectedCustomExplorerIndex = value;
+                OnPropertyChanged(nameof(SelectedCustomExplorerIndex));
                 OnPropertyChanged(nameof(CustomExplorer));
             }
Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs (1)

14-16: Make comparison explicit and culture-safe

Be explicit about comparison semantics.

-[JsonIgnore]
-public string DisplayName => Name == "Explorer" ? API.GetTranslation("fileManagerExplorer") : Name;
+[JsonIgnore]
+public string DisplayName =>
+    string.Equals(Name, "Explorer", StringComparison.Ordinal)
+        ? API.GetTranslation("fileManagerExplorer")
+        : Name;
Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs (1)

14-16: DisplayName logic: OK; make comparison explicit

Same nit on string comparison semantics as Explorer.

-[JsonIgnore]
-public string DisplayName => Name == "Default" ? API.GetTranslation("defaultBrowser_default") : Name;
+[JsonIgnore]
+public string DisplayName =>
+    string.Equals(Name, "Default", StringComparison.Ordinal)
+        ? API.GetTranslation("defaultBrowser_default")
+        : Name;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2dd4160 and 256ae5c.

📒 Files selected for processing (12)
  • Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs (2 hunks)
  • Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs (2 hunks)
  • Flow.Launcher.Infrastructure/Win32Helper.cs (2 hunks)
  • Flow.Launcher/Languages/en.xaml (2 hunks)
  • Flow.Launcher/SelectBrowserWindow.xaml (1 hunks)
  • Flow.Launcher/SelectBrowserWindow.xaml.cs (2 hunks)
  • Flow.Launcher/SelectFileManagerWindow.xaml (1 hunks)
  • Flow.Launcher/SelectFileManagerWindow.xaml.cs (2 hunks)
  • Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs (2 hunks)
  • Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml (2 hunks)
  • Flow.Launcher/ViewModel/SelectBrowserViewModel.cs (2 hunks)
  • Flow.Launcher/ViewModel/SelectFileManagerViewModel.cs (2 hunks)
🧰 Additional context used
🧠 Learnings (8)
📚 Learning: 2024-11-03T07:40:11.014Z
Learnt from: Yusyuriv
PR: Flow-Launcher/Flow.Launcher#3057
File: Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs:0-0
Timestamp: 2024-11-03T07:40:11.014Z
Learning: In Flow Launcher, when using Windows Forms dialogs (e.g., in `JsonRPCPluginSettings.cs`), path validation is enabled by default in `OpenFileDialog` and `FolderBrowserDialog`, preventing users from selecting invalid paths, but it's possible to opt out of this validation on individual dialogs.

Applied to files:

  • Flow.Launcher/SelectFileManagerWindow.xaml.cs
  • Flow.Launcher.Infrastructure/Win32Helper.cs
  • Flow.Launcher/SelectBrowserWindow.xaml.cs
📚 Learning: 2025-09-05T11:56:27.267Z
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3593
File: Flow.Launcher/HotkeyControlDialog.xaml:6-6
Timestamp: 2025-09-05T11:56:27.267Z
Learning: In Flow.Launcher's migration to iNKORE.UI.WPF.Modern UI framework, dialog resource keys like PopuBGColor, PopupButtonAreaBGColor, PopupButtonAreaBorderColor, and PopupTextColor are provided by the iNKORE.UI.WPF.Modern framework itself, not defined locally in the codebase theme files.

Applied to files:

  • Flow.Launcher/SelectFileManagerWindow.xaml.cs
  • Flow.Launcher/SelectBrowserWindow.xaml.cs
📚 Learning: 2025-06-08T14:12:21.348Z
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3672
File: Flow.Launcher/MainWindow.xaml.cs:244-247
Timestamp: 2025-06-08T14:12:21.348Z
Learning: In Flow.Launcher, App.NotifyIcon is created before MainWindow creation, so null checks for App.NotifyIcon are not necessary when accessing it from MainWindow code.

Applied to files:

  • Flow.Launcher/SelectFileManagerWindow.xaml.cs
  • Flow.Launcher/SelectBrowserWindow.xaml.cs
📚 Learning: 2025-06-08T14:12:12.842Z
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3672
File: Flow.Launcher/MainWindow.xaml.cs:318-318
Timestamp: 2025-06-08T14:12:12.842Z
Learning: In Flow.Launcher, the App.NotifyIcon static property is initialized in the App class before MainWindow creation, so null checks are not needed when accessing App.NotifyIcon in MainWindow lifecycle methods.

Applied to files:

  • Flow.Launcher/SelectBrowserWindow.xaml.cs
📚 Learning: 2025-07-21T09:19:49.684Z
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3854
File: Flow.Launcher/App.xaml.cs:246-262
Timestamp: 2025-07-21T09:19:49.684Z
Learning: In Flow Launcher's App.xaml.cs, the asynchronous plugin initialization task (containing AbstractPluginEnvironment.PreStartPluginExecutablePathUpdate, PluginManager.LoadPlugins, PluginManager.InitializePluginsAsync, and AutoPluginUpdates) does not require additional try-catch error handling according to maintainer Jack251970, as these operations are designed to handle exceptions internally.

Applied to files:

  • Flow.Launcher/SelectBrowserWindow.xaml.cs
📚 Learning: 2025-03-28T21:20:54.978Z
Learnt from: onesounds
PR: Flow-Launcher/Flow.Launcher#3394
File: Flow.Launcher/Themes/Darker Glass.xaml:134-141
Timestamp: 2025-03-28T21:20:54.978Z
Learning: In WPF applications like Flow.Launcher, Border elements cannot directly display text content and require a child element like TextBlock to handle text rendering. This separation of concerns (Border for visual container styling, TextBlock for text display) follows WPF best practices and provides greater styling flexibility.

Applied to files:

  • Flow.Launcher/SelectBrowserWindow.xaml.cs
📚 Learning: 2025-04-23T15:14:49.986Z
Learnt from: onesounds
PR: Flow-Launcher/Flow.Launcher#0
File: :0-0
Timestamp: 2025-04-23T15:14:49.986Z
Learning: In WPF applications like Flow.Launcher, font styling should be applied using implicit styles instead of setting the FontFamily property on individual controls. Define implicit styles in a ResourceDictionary using <Style TargetType="{x:Type Button}"> format and merge it into App.xaml, which automatically applies the font to all instances of the control type while still allowing explicit overrides where needed.

Applied to files:

  • Flow.Launcher/SelectBrowserWindow.xaml.cs
📚 Learning: 2025-06-24T19:06:48.344Z
Learnt from: Koisu-unavailable
PR: Flow-Launcher/Flow.Launcher#3770
File: Flow.Launcher/ViewModel/MainViewModel.cs:0-0
Timestamp: 2025-06-24T19:06:48.344Z
Learning: In Flow.Launcher's Explorer plugin results, the SubTitle property always contains the directory containing the file. For file results, Title contains the filename and SubTitle contains the parent directory. For directory results, SubTitle contains the directory path itself.

Applied to files:

  • Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs
🧬 Code graph analysis (7)
Flow.Launcher/SelectFileManagerWindow.xaml.cs (4)
Flow.Launcher/App.xaml.cs (2)
  • App (31-447)
  • App (56-116)
Flow.Launcher/PublicAPIInstance.cs (2)
  • OpenUrl (464-467)
  • OpenUrl (469-472)
Flow.Launcher/SelectBrowserWindow.xaml.cs (1)
  • btnBrowseFile_Click (33-44)
Flow.Launcher.Infrastructure/Win32Helper.cs (2)
  • Win32Helper (31-921)
  • SelectFile (910-918)
Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs (3)
Flow.Launcher.Infrastructure/UserSettings/Settings.cs (1)
  • Settings (16-616)
Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs (1)
  • OnDisplayNameChanged (37-40)
Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs (1)
  • OnDisplayNameChanged (33-36)
Flow.Launcher/SelectBrowserWindow.xaml.cs (1)
Flow.Launcher.Infrastructure/Win32Helper.cs (2)
  • Win32Helper (31-921)
  • SelectFile (910-918)
Flow.Launcher/ViewModel/SelectBrowserViewModel.cs (2)
Plugins/Flow.Launcher.Plugin.BrowserBookmark/Models/CustomBrowser.cs (1)
  • CustomBrowser (6-52)
Flow.Launcher/App.xaml.cs (2)
  • App (31-447)
  • App (56-116)
Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs (1)
Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs (1)
  • OnDisplayNameChanged (37-40)
Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs (1)
Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs (1)
  • OnDisplayNameChanged (33-36)
Flow.Launcher/ViewModel/SelectFileManagerViewModel.cs (1)
Flow.Launcher/App.xaml.cs (2)
  • App (31-447)
  • App (56-116)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: gitStream.cm
  • GitHub Check: build
🔇 Additional comments (10)
Flow.Launcher/SelectFileManagerWindow.xaml (1)

105-105: LGTM: bind to DisplayName.

Switching the item template to DisplayName matches the new localization model.

Flow.Launcher/SelectBrowserWindow.xaml (1)

95-95: LGTM: DisplayName binding.

This aligns with translated labels for “Default”.

Flow.Launcher/ViewModel/SelectBrowserViewModel.cs (1)

53-54: LGTM: translated default name for new profile.

Good use of defaultBrowser_new_profile.

Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml (2)

406-406: LGTM: use DisplayName for default file manager.


418-418: LGTM: use DisplayName for default browser.

Flow.Launcher/ViewModel/SelectFileManagerViewModel.cs (1)

108-109: LGTM: localized default name

Using App.API.GetTranslation("defaultBrowser_new_profile") aligns with the new resource keys.

If you keep the browser‑prefixed key here long‑term, ensure translators get context that it's also used for file manager profiles.

Flow.Launcher.Infrastructure/UserSettings/CustomExplorerViewModel.cs (2)

9-12: Lazy API resolver: OK

Static lazy resolve via Ioc.Default avoids multiple IPublicAPI instances.


32-36: DisplayName change notifier: OK

Flow.Launcher/Languages/en.xaml (1)

490-490: Ensure localization keys exist in all non-en locale XAML files

Confirm these keys are present in every file under Flow.Launcher/Languages/*.xaml (e.g., es.xaml): fileManagerExplorer, defaultBrowser_default, defaultBrowser_new_profile. If any are missing, add translations or an English fallback and re-run the verification script; attach the script output.

Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs (1)

1-2: JsonIgnore (System.Text.Json) is correct — settings use System.Text.Json

Flow.Launcher persists settings with System.Text.Json (see Flow.Launcher.Infrastructure/Storage/JsonStorage.cs), so the System.Text.Json.Serialization.JsonIgnore on Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs is appropriate; Newtonsoft.Json only appears in package locks.

@Jack251970 Jack251970 requested a review from Copilot September 18, 2025 04:36
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Jack251970 Jack251970 merged commit 820304c into dev Sep 18, 2025
10 checks passed
@Jack251970 Jack251970 deleted the default_browser_explorer_translation branch September 18, 2025 04:58
@coderabbitai coderabbitai bot added the enhancement New feature or request label Sep 18, 2025
@jjw24 jjw24 removed the enhancement New feature or request label Sep 18, 2025
@jjw24 jjw24 removed this from the 2.1.0 milestone Sep 21, 2025
@jjw24 jjw24 added this to the 2.0.1 milestone Sep 21, 2025
jjw24 pushed a commit that referenced this pull request Sep 21, 2025
…translation

Add Default Browser & File Explorer & New Profile Translation & Ignore index change for -1
@jjw24 jjw24 mentioned this pull request Sep 21, 2025
TBM13 pushed a commit to TBM13/Flow.Launcher that referenced this pull request Sep 23, 2025
…ser_explorer_translation

Add Default Browser & File Explorer & New Profile Translation & Ignore index change for -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kind/ui related to UI, icons, themes, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Translation Missing Issue BUG: Spanish translation missing
3 participants